﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace UserNotificationAspMvc.Models
{
    public enum GripPositon 
    {
        top,
        bottom,
        right,
        left
    }

    public class UserNotificationAttached : UserNotification
    {
        public string TargetId { get; set; }
        public GripPositon Grip { get; set; }


        public UserNotificationAttached(string m, NotificationType t, ushort a, ushort w, BarAnimationDirection b, string targetIt, GripPositon grip = GripPositon.right)
            : this(m, t, a, w, b)
        {
            TargetId = targetIt;
            Grip = grip;
            IsAttached = true;
        }


        public UserNotificationAttached(string m,NotificationType t,ushort a, ushort w,BarAnimationDirection b) : base(m,t,a,w,b)
        {
        }

        public override string ToString()
        {
            return String.Format(@" MVCNotificationQueue.Add(new MVCNotification('{0}','{1}',{2},'{3}','{4}',{5},'{6}',{7},'{8}','{9}')); ",
                                   this.NotificationId,
                                   this.Type.ToString().ToLower(),
                                   this.Duration,
                                   this.Message.Replace("'", "\'"),
                                   this.Scream,
                                   this.Width,
                                   this.AnimationBarDirection,
                                   this.IsAttached.ToString().ToLower(),
                                   this.TargetId,
                                   this.Grip
                                   );
        }
    }
}